<?php class Fleetinfo { 

    /***
     * DB Fields: id
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $id;

    /***
     * DB Fields: name
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $name;

    /***
     * DB Fields: description
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $description;

    /***
     * DB Fields: image
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $image;

    /***
     * DB Fields: structure
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $structure;

    /***
     * DB Fields: shield
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $shield;

    /***
     * DB Fields: damage
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $damage;

    /***
     * DB Fields: priceMetal
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $priceMetal;

    /***
     * DB Fields: priceCrystal
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $priceCrystal;

    /***
     * DB Fields: priceDeuterium
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $priceDeuterium;

    /***
     * DB Fields: capacidad
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $capacidad;

    /***
     * DB Fields: velocidad
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $velocidad;

    /***
     * DB Fields: velocidad2
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $velocidad2;

    /***
     * DB Fields: consumo
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $consumo;

    /***
     * DB Fields: consumo2
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $consumo2;

    /***
     * DB Fields: order
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $order;

    /***
     * DB Fields: speedRatio
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $speedRatio;

//--------------- GET METHODS ----------------------------- //
    /***
     * Get value for field: id
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result id
     **/
    function get_id( ) {
        // returns the value of id
        return $this->id;
    }


    /***
     * Get value for field: name
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result name
     **/
    function get_name( ) {
        // returns the value of name
        return $this->name;
    }


    /***
     * Get value for field: description
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result description
     **/
    function get_description( ) {
        // returns the value of description
        return $this->description;
    }


    /***
     * Get value for field: image
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result image
     **/
    function get_image( ) {
        // returns the value of image
        return $this->image;
    }


    /***
     * Get value for field: structure
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result structure
     **/
    function get_structure( ) {
        // returns the value of structure
        return $this->structure;
    }


    /***
     * Get value for field: shield
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result shield
     **/
    function get_shield( ) {
        // returns the value of shield
        return $this->shield;
    }


    /***
     * Get value for field: damage
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result damage
     **/
    function get_damage( ) {
        // returns the value of damage
        return $this->damage;
    }


    /***
     * Get value for field: priceMetal
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result priceMetal
     **/
    function get_priceMetal( ) {
        // returns the value of priceMetal
        return $this->priceMetal;
    }


    /***
     * Get value for field: priceCrystal
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result priceCrystal
     **/
    function get_priceCrystal( ) {
        // returns the value of priceCrystal
        return $this->priceCrystal;
    }


    /***
     * Get value for field: priceDeuterium
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result priceDeuterium
     **/
    function get_priceDeuterium( ) {
        // returns the value of priceDeuterium
        return $this->priceDeuterium;
    }


    /***
     * Get value for field: capacidad
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result capacidad
     **/
    function get_capacidad( ) {
        // returns the value of capacidad
        return $this->capacidad;
    }


    /***
     * Get value for field: velocidad
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result velocidad
     **/
    function get_velocidad( ) {
        // returns the value of velocidad
        return $this->velocidad;
    }


    /***
     * Get value for field: velocidad2
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result velocidad2
     **/
    function get_velocidad2( ) {
        // returns the value of velocidad2
        return $this->velocidad2;
    }


    /***
     * Get value for field: consumo
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result consumo
     **/
    function get_consumo( ) {
        // returns the value of consumo
        return $this->consumo;
    }


    /***
     * Get value for field: consumo2
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result consumo2
     **/
    function get_consumo2( ) {
        // returns the value of consumo2
        return $this->consumo2;
    }


    /***
     * Get value for field: order
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result order
     **/
    function get_order( ) {
        // returns the value of order
        return $this->order;
    }


    /***
     * Get value for field: speedRatio
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result speedRatio
     **/
    function get_speedRatio( ) {
        // returns the value of speedRatio
        return $this->speedRatio;
    }


//--------------- SET METHODS ----------------------------- //
    /***
     * Set value for field: id
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param id
     * @result void
     **/
    function set_id( $id ) {
        // sets the value of id
        $this->id = $id;
    }

    /***
     * Set value for field: name
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param name
     * @result void
     **/
    function set_name( $name ) {
        // sets the value of name
        $this->name = $name;
    }

    /***
     * Set value for field: description
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param description
     * @result void
     **/
    function set_description( $description ) {
        // sets the value of description
        $this->description = $description;
    }

    /***
     * Set value for field: image
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param image
     * @result void
     **/
    function set_image( $image ) {
        // sets the value of image
        $this->image = $image;
    }

    /***
     * Set value for field: structure
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param structure
     * @result void
     **/
    function set_structure( $structure ) {
        // sets the value of structure
        $this->structure = $structure;
    }

    /***
     * Set value for field: shield
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param shield
     * @result void
     **/
    function set_shield( $shield ) {
        // sets the value of shield
        $this->shield = $shield;
    }

    /***
     * Set value for field: damage
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param damage
     * @result void
     **/
    function set_damage( $damage ) {
        // sets the value of damage
        $this->damage = $damage;
    }

    /***
     * Set value for field: priceMetal
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param priceMetal
     * @result void
     **/
    function set_priceMetal( $priceMetal ) {
        // sets the value of priceMetal
        $this->priceMetal = $priceMetal;
    }

    /***
     * Set value for field: priceCrystal
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param priceCrystal
     * @result void
     **/
    function set_priceCrystal( $priceCrystal ) {
        // sets the value of priceCrystal
        $this->priceCrystal = $priceCrystal;
    }

    /***
     * Set value for field: priceDeuterium
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param priceDeuterium
     * @result void
     **/
    function set_priceDeuterium( $priceDeuterium ) {
        // sets the value of priceDeuterium
        $this->priceDeuterium = $priceDeuterium;
    }

    /***
     * Set value for field: capacidad
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param capacidad
     * @result void
     **/
    function set_capacidad( $capacidad ) {
        // sets the value of capacidad
        $this->capacidad = $capacidad;
    }

    /***
     * Set value for field: velocidad
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param velocidad
     * @result void
     **/
    function set_velocidad( $velocidad ) {
        // sets the value of velocidad
        $this->velocidad = $velocidad;
    }

    /***
     * Set value for field: velocidad2
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param velocidad2
     * @result void
     **/
    function set_velocidad2( $velocidad2 ) {
        // sets the value of velocidad2
        $this->velocidad2 = $velocidad2;
    }

    /***
     * Set value for field: consumo
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param consumo
     * @result void
     **/
    function set_consumo( $consumo ) {
        // sets the value of consumo
        $this->consumo = $consumo;
    }

    /***
     * Set value for field: consumo2
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param consumo2
     * @result void
     **/
    function set_consumo2( $consumo2 ) {
        // sets the value of consumo2
        $this->consumo2 = $consumo2;
    }

    /***
     * Set value for field: order
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param order
     * @result void
     **/
    function set_order( $order ) {
        // sets the value of order
        $this->order = $order;
    }

    /***
     * Set value for field: speedRatio
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param speedRatio
     * @result void
     **/
    function set_speedRatio( $speedRatio ) {
        // sets the value of speedRatio
        $this->speedRatio = $speedRatio;
    }

//--------------- CRUD METHODS ----------------------------- //
    /***
     * Create a new Record: fleetinfo
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param id
     * @param name
     * @param description
     * @param image
     * @param structure
     * @param shield
     * @param damage
     * @param priceMetal
     * @param priceCrystal
     * @param priceDeuterium
     * @param capacidad
     * @param velocidad
     * @param velocidad2
     * @param consumo
     * @param consumo2
     * @param order
     * @param speedRatio
     * @result void
     **/
    function createnew_fleetinfo( $id, $name, $description, $image, $structure, $shield, $damage, $priceMetal, $priceCrystal, $priceDeuterium, $capacidad, $velocidad, $velocidad2, $consumo, $consumo2, $order, $speedRatio ) {

        // items to be inserted in the database 
        $_obj = array($id,
                      $name,
                      $description,
                      $image,
                      $structure,
                      $shield,
                      $damage,
                      $priceMetal,
                      $priceCrystal,
                      $priceDeuterium,
                      $capacidad,
                      $velocidad,
                      $velocidad2,
                      $consumo,
                      $consumo2,
                      $order,
                      $speedRatio); 

        // database object connection
        $dbConn = $GLOBALS['dbConn'];

        // perform insert in the database
        $dbConn->insert("fleetinfo", $_obj);
    }

    /***
     * Retrived an existing record: fleetinfo
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param id
     * @result new Fleetinfo
     **/
    function get_fleetinfo( $id ) {

        // retrive the data
        $dbConn = $GLOBALS['dbConn'];

        // retrieved value in the database
        $_resultSet = $dbConn->doQuery("SELECT * FROM fleetinfo WHERE id = '$id'");

        $__fleetinfoObj = new fleetinfo();
        // return the retrived from the database

        // create a new object
        $__obj = new Fleetinfo();
        $__obj->set_id($_resultSet[0]['id']);
        $__obj->set_name($_resultSet[0]['name']);
        $__obj->set_description($_resultSet[0]['description']);
        $__obj->set_image($_resultSet[0]['image']);
        $__obj->set_structure($_resultSet[0]['structure']);
        $__obj->set_shield($_resultSet[0]['shield']);
        $__obj->set_damage($_resultSet[0]['damage']);
        $__obj->set_priceMetal($_resultSet[0]['priceMetal']);
        $__obj->set_priceCrystal($_resultSet[0]['priceCrystal']);
        $__obj->set_priceDeuterium($_resultSet[0]['priceDeuterium']);
        $__obj->set_capacidad($_resultSet[0]['capacidad']);
        $__obj->set_velocidad($_resultSet[0]['velocidad']);
        $__obj->set_velocidad2($_resultSet[0]['velocidad2']);
        $__obj->set_consumo($_resultSet[0]['consumo']);
        $__obj->set_consumo2($_resultSet[0]['consumo2']);
        $__obj->set_order($_resultSet[0]['order']);
        $__obj->set_speedRatio($_resultSet[0]['speedRatio']);


        return $__obj;
    }

    /***
     * Update an existing record: fleetinfo
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param id
     * @param itemsToBeUpdated = array()
     * @result void
     **/
    function update_fleetinfo( $id, $itemsToBeUpdated = array() ) {

         // get database connection
         $dbConn = $GLOBALS['dbConn'];

         // performs update in the database
         foreach($itemsToBeUpdated as $_fName => $_fVal) { 
               $dbConn->addValuePair($_fName, $_fVal);
         }

         // perform update operation
         $dbConn->update("fleetinfo", "id = '$id'");
    }

    /***
     * Delete an existing record: fleetinfo
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param id
     * @result void
     **/
    function delete_fleetinfo( $id ) {

         // get database connection
         $dbConn = $GLOBALS['dbConn'];

         // performs deletion of data
         $dbConn->delete("fleetinfo", "id = '$id'");
    }

    /***
     * Retrived list of objects base on a given parameters: fleetinfo
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param conditionalStatement = ''
     * @result collection of objects: Fleetinfo
     **/
    function list_fleetinfo( $conditionalStatement = '' ) {

         $dbConn = $GLOBALS['dbConn'];
         // check if there is a given parameter list
         if(!empty($conditionalStatement)) { 
              $sqlStatement = "SELECT * FROM fleetinfo WHERE $conditionalStatement"; 
         } else { 
              $sqlStatement = "SELECT * FROM fleetinfo";
         }

         // retrieve the values base on the query result
         $__resObj = $dbConn->doQuery($sqlStatement);

         $__collectionOfObjects = array();
         foreach($__resObj as $__rs) { 
            $__newObj = new Fleetinfo();

            $__newObj->set_id($__rs['id']);
            $__newObj->set_name($__rs['name']);
            $__newObj->set_description($__rs['description']);
            $__newObj->set_image($__rs['image']);
            $__newObj->set_structure($__rs['structure']);
            $__newObj->set_shield($__rs['shield']);
            $__newObj->set_damage($__rs['damage']);
            $__newObj->set_priceMetal($__rs['priceMetal']);
            $__newObj->set_priceCrystal($__rs['priceCrystal']);
            $__newObj->set_priceDeuterium($__rs['priceDeuterium']);
            $__newObj->set_capacidad($__rs['capacidad']);
            $__newObj->set_velocidad($__rs['velocidad']);
            $__newObj->set_velocidad2($__rs['velocidad2']);
            $__newObj->set_consumo($__rs['consumo']);
            $__newObj->set_consumo2($__rs['consumo2']);
            $__newObj->set_order($__rs['order']);
            $__newObj->set_speedRatio($__rs['speedRatio']);

            // add object to collection 
            array_push($__collectionOfObjects, $__newObj);
         }

         // return collection of objects
         return $__collectionOfObjects;
    }

} ?>